//
// Decompiled with: Decompiler.NET, Version=1.3.1.18439, Culture=neutral, PublicKeyToken=null, Version: 1.3.1.18439
// Decompilation Started at: 3/15/2009 10:34:26 PM
// Copyright 2003 - 2004, Jungle Creatures, Inc., All Rights Reserved. 
// Written by Jonathan Pierce, Email: support@junglecreatures.com
//

namespace PatientManagement

{
		
		#region Namespace Import Declarations
		
			using System.Collections;
			using System.ComponentModel;
			using System.Data.Common;
			using System.Data;
			using System.Data.SqlClient;
			using System.Drawing;
			using System;
			using System.Resources;
			using System.Windows.Forms;
			using Utility;
			
		#endregion
		
	public class frmXetNghiem : Form
	
	{
		
		#region Fields
			private ArrayList arrCha;
			private ArrayList arrPltISN;
			private ArrayList arrPltName;
			private Button btClose;
			private Button btExit;
			private Button btLuu;
			private Button btThoat;
			private Button btUpdate;
			private Button btXoa;
			private bool check;
			private Container components;
			private string con;
			private int count;
			private Database_Com db;
			public int flag;
			private Label label1;
			private Label label2;
			private Label label3;
			private Label label6;
			private Label label9;
			private Label lbTen;
			private TreeNode node;
			private TreeNode node2;
			private TreeNode node3;
			private TreeNode node4;
			private TreeNode node5;
			private RadioButton raCha;
			private RadioButton raCon;
			private TabControl tab;
			private TabPage tbCapNhat;
			private TabPage tbThem;
			private TabPage tbXoa;
			private TreeView tvBenh;
			private TextBox txtNew;
			private TextBox txtOld;
			private TextBox txtTenTuongUng;
			private TextBox txtXetNghiemMoi;
			private TextBox txtXoa;
		#endregion
		
		#region Constructors
		
			public frmXetNghiem ()
			
			{
				this.components = ((System.ComponentModel.Container) null);
				this.flag = 1;
				this.count = 0;
				this.arrPltISN = new ArrayList ();
				this.arrPltName = new ArrayList ();
				this.arrCha = new ArrayList ();
				this.db = new Database_Com ();
				this.InitializeComponent ();
				this.con = Connection.ConnectionString ();
				return;
			}
			
		#endregion
		
		#region Methods
		
			private void btClose_Click (object sender, EventArgs e)
			
			{
				base.Close ();
				return;
			}
			
			private void btExit_Click (object sender, EventArgs e)
			
			{
				base.Close ();
				return;
			}
			
			private void btLuu_Click (object sender, EventArgs e)
			
			{
				MyNode theMyNode;
				string theString;
				string[] theStringArray;
				object[] theObjectArray;
				string[] theStringArray2;
				SqlDbType[] theSqlDbTypeArray;
				object[] theObjectArray2;
				string[] theStringArray3;
				SqlDbType[] theSqlDbTypeArray2;
				object[] theObjectArray3;
				if (this.txtTenTuongUng.Visible)
				{
					goto L_0113;
				}
				if (this.txtXetNghiemMoi.Text != "")
				{
					goto L_003F;
				}
				DialogResult theDialogResult = MessageBox.Show ("Vui l?ng nh?p t?n x?t nghi?m m?i!", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_02F7;
				
			L_003F:
				
				{
				}
				SqlConnection theSqlConnection = this.db.CreateConnections ();
				this.checkTenXN (this.txtXetNghiemMoi.Text);
				if (this.check)
				{
					goto L_007C;
				}
				DialogResult theDialogResult2 = MessageBox.Show ("T?n x?t nghi?m ?? t?n t?i!", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_02F7;
				
			L_007C:
				
				{
				}
				theStringArray = new string[1];
				theStringArray[0] = "@name";
				theObjectArray = new object[1];
				theObjectArray[0] = this.txtXetNghiemMoi.Text;
				int i = this.db.ExecuteNonQueryWithParam ("Insert AnalyzePatient values (0,@name)", theStringArray, theObjectArray);
				DialogResult theDialogResult3 = MessageBox.Show ("?? l?u t?n x?t nghi?m m?i!", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.frmXetNghiem_Load (sender, e);
				this.txtXoa.Text = "";
				this.txtOld.Text = "";
				this.txtTenTuongUng.Text = "";
				this.txtXetNghiemMoi.Text = "";
				goto L_02F7;
				
			L_0113:
				
				{
				}
				if (this.txtXetNghiemMoi.Text != "")
				{
					goto L_0142;
				}
				DialogResult theDialogResult4 = MessageBox.Show ("Vui l?ng nh?p t?n x?t nghi?m m?i!", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_02F7;
				
			L_0142:
				
				{
				}
				SqlConnection theSqlConnection2 = this.db.CreateConnections ();
				this.checkTenXN (this.txtXetNghiemMoi.Text);
				if (this.check)
				{
					goto L_017F;
				}
				DialogResult theDialogResult5 = MessageBox.Show ("T?n x?t nghi?m ?? t?n t?i!", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_02F7;
				
			L_017F:
				
				{
				}
				theMyNode = ((MyNode) this.tvBenh.SelectedNode);
				theString = string.Empty;
				theString = theMyNode.DataRow[0].ToString ();
				if (! this.raCha.Checked)
				{
					goto L_022C;
				}
				theStringArray2 = new string[3];
				theStringArray2[0] = "@nlpName";
				theStringArray2[1] = "@nlpRootISN";
				theStringArray2[2] = "@status";
				theSqlDbTypeArray = new SqlDbType[3];
				theSqlDbTypeArray[0] = SqlDbType.NVarChar;
				theSqlDbTypeArray[1] = SqlDbType.Int;
				theSqlDbTypeArray[2] = SqlDbType.Int;
				theObjectArray2 = new object[3];
				theObjectArray2[0] = this.txtXetNghiemMoi.Text;
				theObjectArray2[1] = theString;
				theObjectArray2[2] = 0;
				this.db.ExecuteStoredProc ("sp_AnalyzePatient_Insert ", theStringArray2, theSqlDbTypeArray, theObjectArray2);
				
			L_022C:
				
				{
				}
				if (! this.raCon.Checked)
				{
					goto L_02B0;
				}
				theStringArray3 = new string[3];
				theStringArray3[0] = "@nlpName";
				theStringArray3[1] = "@nlpRootISN";
				theStringArray3[2] = "@status";
				theSqlDbTypeArray2 = new SqlDbType[3];
				theSqlDbTypeArray2[0] = SqlDbType.NVarChar;
				theSqlDbTypeArray2[1] = SqlDbType.Int;
				theSqlDbTypeArray2[2] = SqlDbType.Int;
				theObjectArray3 = new object[3];
				theObjectArray3[0] = this.txtXetNghiemMoi.Text;
				theObjectArray3[1] = theString;
				theObjectArray3[2] = 1;
				this.db.ExecuteStoredProc ("sp_AnalyzePatient_Insert ", theStringArray3, theSqlDbTypeArray2, theObjectArray3);
				
			L_02B0:
				
				{
				}
				DialogResult theDialogResult6 = MessageBox.Show ("?? l?u t?n x?t nghi?m m?i!", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.frmXetNghiem_Load (sender, e);
				this.txtTenTuongUng.Text = "";
				this.txtXetNghiemMoi.Text = "";
				this.btLuu.Enabled = false;
				
			L_02F7:
				return;
			}
			
			private void btThoat_Click (object sender, EventArgs e)
			
			{
				base.Close ();
				return;
			}
			
			private void btUpdate_Click (object sender, EventArgs e)
			
			{
				MyNode theMyNode;
				string theString;
				string[] theStringArray;
				SqlDbType[] theSqlDbTypeArray;
				object[] theObjectArray;
				if (this.txtOld.Text != "")
				{
					goto L_002F;
				}
				DialogResult theDialogResult = MessageBox.Show ("Vui l?ng ch?n t?n x?t nghi?m c?n c?p nh?t!", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_0182;
				
			L_002F:
				
				{
				}
				if (this.txtNew.Text != "")
				{
					goto L_005E;
				}
				DialogResult theDialogResult2 = MessageBox.Show ("Vui l?ng nh?p t?n x?t nghi?m m?i c?n c?p nh?t!", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_0182;
				
			L_005E:
				
				{
				}
				SqlConnection theSqlConnection = this.db.CreateConnections ();
				this.checkTenXN (this.txtNew.Text);
				if (this.check)
				{
					goto L_009B;
				}
				DialogResult theDialogResult3 = MessageBox.Show ("T?n x?t nghi?m ?? t?n t?i!", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_0182;
				
			L_009B:
				
				{
				}
				theMyNode = ((MyNode) this.tvBenh.SelectedNode);
				theString = string.Empty;
				theString = theMyNode.DataRow[0].ToString ();
				theStringArray = new string[2];
				theStringArray[0] = "@nlpName";
				theStringArray[1] = "@nlpOldISN";
				theSqlDbTypeArray = new SqlDbType[2];
				theSqlDbTypeArray[0] = SqlDbType.NVarChar;
				theSqlDbTypeArray[1] = SqlDbType.Int;
				theObjectArray = new object[2];
				theObjectArray[0] = this.txtNew.Text;
				theObjectArray[1] = theString;
				this.db.ExecuteStoredProc ("sp_AnalyzePatient_Update", theStringArray, theSqlDbTypeArray, theObjectArray);
				DialogResult theDialogResult4 = MessageBox.Show ("?? c?p nh?t t?n x?t nghi?m!", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.frmXetNghiem_Load (sender, e);
				this.txtXoa.Text = "";
				this.txtNew.Text = "";
				this.txtOld.Text = "";
				this.txtTenTuongUng.Text = "";
				this.btUpdate.Enabled = false;
				
			L_0182:
				return;
			}
			
			private void btXoa_Click (object sender, EventArgs e)
			
			{
				MyNode theMyNode;
				string theString;
				string[] theStringArray;
				SqlDbType[] theSqlDbTypeArray;
				object[] theObjectArray;
				if (this.txtXoa.Text != "")
				{
					goto L_002F;
				}
				DialogResult theDialogResult = MessageBox.Show ("Vui l?ng ch?n t?n x?t nghi?m m?i c?n x?a!", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_00F6;
				
			L_002F:
				
				{
				}
				SqlConnection theSqlConnection = this.db.CreateConnections ();
				theMyNode = ((MyNode) this.tvBenh.SelectedNode);
				theString = string.Empty;
				theString = theMyNode.DataRow[0].ToString ();
				theStringArray = new string[1];
				theStringArray[0] = "@nlpISN";
				theSqlDbTypeArray = new SqlDbType[1];
				theSqlDbTypeArray[0] = SqlDbType.Int;
				theObjectArray = new object[1];
				theObjectArray[0] = theString;
				this.db.ExecuteStoredProc ("sp_AnalyzePatient_Delete", theStringArray, theSqlDbTypeArray, theObjectArray);
				DialogResult theDialogResult2 = MessageBox.Show ("?? x?a t?n x?t nghi?m!", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.frmXetNghiem_Load (sender, e);
				this.btXoa.Enabled = false;
				this.txtXoa.Text = "";
				this.txtOld.Text = "";
				this.txtTenTuongUng.Text = "";
				
			L_00F6:
				return;
			}
			
			public void checkTenXN (string text)
			
			{
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				int i;
				this.check = true;
				theSqlDataAdapter = new SqlDataAdapter ("select * from AnalyzePatient ", this.con);
				theDataSet = new DataSet ();
				int i2 = theSqlDataAdapter.Fill (theDataSet, "vw_AnalyzeTree");
				i = 0;
				goto L_006E;
				
			L_002F:
				
				{
				}
				if (theDataSet.Tables["vw_AnalyzeTree"].Rows[i]["nlpName"].ToString () != text)
				{
					goto L_006A;
				}
				this.check = false;
				goto L_008B;
				
			L_006A:
				
				{
				}
				i++;
				
			L_006E:
				
				{
				}
				if (i < theDataSet.Tables["vw_AnalyzeTree"].Rows.Count)
				{
					goto L_002F;
				}
				
			L_008B:
				return;
			}
			
			protected override void Dispose (bool disposing)
			
			{
				this.flag = 0;
				if (! disposing)
				{
					goto L_001D;
				}
				if (this.components == null)
				{
					goto L_001D;
				}
				this.components.Dispose ();
				
			L_001D:
				
				{
				}
				base.Dispose (disposing);
				return;
			}
			
			private void frmXetNghiem_Load (object sender, EventArgs e)
			
			{
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				this.count++;
				this.tvBenh.Nodes.Clear ();
				this.raCha_CheckedChanged (sender, e);
				theSqlConnection = new SqlConnection (this.con);
				theSqlDataAdapter = new SqlDataAdapter ("select * from AnalyzePatient ", theSqlConnection);
				theDataSet = new DataSet ();
				int i = theSqlDataAdapter.Fill (theDataSet, "vw_AnalyzeTree");
				if ((theDataSet != null) && ((theDataSet.Tables.Count != 0) && (theDataSet.Tables["vw_AnalyzeTree"].Rows.Count != 0)))
				{
					goto L_00C5;
				}
				
			L_007D:
				
				{
				}
				this.tbCapNhat.Hide ();
				this.tbXoa.Hide ();
				this.txtTenTuongUng.Visible = false;
				this.raCha.Visible = false;
				this.raCon.Visible = false;
				this.lbTen.Visible = false;
				goto L_010F;
				
			L_00C5:
				
				{
				}
				this.txtTenTuongUng.Visible = true;
				this.raCha.Visible = true;
				this.raCon.Visible = true;
				this.lbTen.Visible = true;
				this.LoadXetNghiem ();
				if (this.count != 1)
				{
					goto L_010F;
				}
				this.tvBenh.CollapseAll ();
				
			L_010F:
				return;
			}
			
			private void InitializeComponent ()
			
			{
				ResourceManager theResourceManager;
				Control[] theControlArray;
				Control[] theControlArray2;
				Control[] theControlArray3;
				Control[] theControlArray4;
				Control[] theControlArray5;
				theResourceManager = new ResourceManager (typeof (frmXetNghiem));
				this.tvBenh = new TreeView ();
				this.label9 = new Label ();
				this.tab = new TabControl ();
				this.tbThem = new TabPage ();
				this.btThoat = new Button ();
				this.btLuu = new Button ();
				this.raCon = new RadioButton ();
				this.raCha = new RadioButton ();
				this.txtTenTuongUng = new TextBox ();
				this.lbTen = new Label ();
				this.txtXetNghiemMoi = new TextBox ();
				this.label6 = new Label ();
				this.tbCapNhat = new TabPage ();
				this.label2 = new Label ();
				this.label1 = new Label ();
				this.txtOld = new TextBox ();
				this.txtNew = new TextBox ();
				this.btUpdate = new Button ();
				this.btClose = new Button ();
				this.tbXoa = new TabPage ();
				this.label3 = new Label ();
				this.btXoa = new Button ();
				this.txtXoa = new TextBox ();
				this.btExit = new Button ();
				this.tab.SuspendLayout ();
				this.tbThem.SuspendLayout ();
				this.tbCapNhat.SuspendLayout ();
				this.tbXoa.SuspendLayout ();
				base.SuspendLayout ();
				this.tvBenh.BorderStyle = BorderStyle.FixedSingle;
				this.tvBenh.Font = new System.Drawing.Font ("Verdana", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.tvBenh.ImageIndex = -1;
				this.tvBenh.Location = new Point (6, 48);
				this.tvBenh.Name = "tvBenh";
				this.tvBenh.SelectedImageIndex = -1;
				this.tvBenh.Size = new System.Drawing.Size (167, 208);
				this.tvBenh.TabIndex = 70;
				this.tvBenh.DoubleClick += new EventHandler (this.tvBenh_DoubleClick);
				this.label9.Font = new System.Drawing.Font ("Verdana", 12F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label9.ForeColor = Color.MediumBlue;
				this.label9.Location = new Point (176, 8);
				this.label9.Name = "label9";
				this.label9.Size = new System.Drawing.Size (224, 23);
				this.label9.TabIndex = 71;
				this.label9.Text = " Danh S?ch X?t Nghi?m";
				this.label9.TextAlign = ContentAlignment.MiddleCenter;
				theControlArray = new Control[3];
				theControlArray[0] = ((Control) this.tbThem);
				theControlArray[1] = ((Control) this.tbCapNhat);
				theControlArray[2] = ((Control) this.tbXoa);
				this.tab.Controls.AddRange (theControlArray);
				this.tab.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.tab.Location = new Point (180, 56);
				this.tab.Name = "tab";
				this.tab.SelectedIndex = 0;
				this.tab.Size = new System.Drawing.Size (376, 200);
				this.tab.TabIndex = 72;
				theControlArray2 = new Control[8];
				theControlArray2[0] = ((Control) this.btThoat);
				theControlArray2[1] = ((Control) this.btLuu);
				theControlArray2[2] = ((Control) this.raCon);
				theControlArray2[3] = ((Control) this.raCha);
				theControlArray2[4] = ((Control) this.txtTenTuongUng);
				theControlArray2[5] = ((Control) this.lbTen);
				theControlArray2[6] = ((Control) this.txtXetNghiemMoi);
				theControlArray2[7] = ((Control) this.label6);
				this.tbThem.Controls.AddRange (theControlArray2);
				this.tbThem.Location = new Point (4, 25);
				this.tbThem.Name = "tbThem";
				this.tbThem.Size = new System.Drawing.Size (368, 171);
				this.tbThem.TabIndex = 0;
				this.tbThem.Text = "Th?m";
				this.btThoat.FlatStyle = FlatStyle.Popup;
				this.btThoat.Location = new Point (240, 124);
				this.btThoat.Name = "btThoat";
				this.btThoat.Size = new System.Drawing.Size (80, 23);
				this.btThoat.TabIndex = 51;
				this.btThoat.Text = "Tho?t";
				this.btThoat.Click += new EventHandler (this.btThoat_Click);
				this.btLuu.FlatStyle = FlatStyle.Popup;
				this.btLuu.Location = new Point (145, 124);
				this.btLuu.Name = "btLuu";
				this.btLuu.Size = new System.Drawing.Size (80, 23);
				this.btLuu.TabIndex = 50;
				this.btLuu.Text = "L?u";
				this.btLuu.Click += new EventHandler (this.btLuu_Click);
				this.raCon.Location = new Point (235, 33);
				this.raCon.Name = "raCon";
				this.raCon.TabIndex = 49;
				this.raCon.Text = "??ng c?p";
				this.raCon.CheckedChanged += new EventHandler (this.raCon_CheckedChanged);
				this.raCha.Checked = true;
				this.raCha.Location = new Point (144, 33);
				this.raCha.Name = "raCha";
				this.raCha.Size = new System.Drawing.Size (88, 24);
				this.raCha.TabIndex = 48;
				this.raCha.TabStop = true;
				this.raCha.Text = "C?p cha";
				this.raCha.CheckedChanged += new EventHandler (this.raCha_CheckedChanged);
				this.txtTenTuongUng.BorderStyle = BorderStyle.FixedSingle;
				this.txtTenTuongUng.ForeColor = SystemColors.HotTrack;
				this.txtTenTuongUng.Location = new Point (144, 64);
				this.txtTenTuongUng.Name = "txtTenTuongUng";
				this.txtTenTuongUng.Size = new System.Drawing.Size (208, 23);
				this.txtTenTuongUng.TabIndex = 46;
				this.txtTenTuongUng.Text = "";
				this.txtTenTuongUng.KeyPress += new KeyPressEventHandler (this.txtTenTuongUng_KeyPress);
				this.lbTen.Location = new Point (22, 62);
				this.lbTen.Name = "lbTen";
				this.lbTen.Size = new System.Drawing.Size (112, 23);
				this.lbTen.TabIndex = 47;
				this.lbTen.Text = "T?n:";
				this.lbTen.TextAlign = ContentAlignment.MiddleRight;
				this.txtXetNghiemMoi.BorderStyle = BorderStyle.FixedSingle;
				this.txtXetNghiemMoi.ForeColor = SystemColors.HotTrack;
				this.txtXetNghiemMoi.Location = new Point (144, 93);
				this.txtXetNghiemMoi.Name = "txtXetNghiemMoi";
				this.txtXetNghiemMoi.Size = new System.Drawing.Size (208, 23);
				this.txtXetNghiemMoi.TabIndex = 44;
				this.txtXetNghiemMoi.Text = "";
				this.label6.Location = new Point (18, 92);
				this.label6.Name = "label6";
				this.label6.Size = new System.Drawing.Size (120, 23);
				this.label6.TabIndex = 45;
				this.label6.Text = "T?n x?t nghi?m:";
				this.label6.TextAlign = ContentAlignment.MiddleRight;
				theControlArray3 = new Control[6];
				theControlArray3[0] = ((Control) this.label2);
				theControlArray3[1] = ((Control) this.label1);
				theControlArray3[2] = ((Control) this.txtOld);
				theControlArray3[3] = ((Control) this.txtNew);
				theControlArray3[4] = ((Control) this.btUpdate);
				theControlArray3[5] = ((Control) this.btClose);
				this.tbCapNhat.Controls.AddRange (theControlArray3);
				this.tbCapNhat.Location = new Point (4, 25);
				this.tbCapNhat.Name = "tbCapNhat";
				this.tbCapNhat.Size = new System.Drawing.Size (368, 171);
				this.tbCapNhat.TabIndex = 1;
				this.tbCapNhat.Text = "C?p Nh?t";
				this.label2.Location = new Point (39, 56);
				this.label2.Name = "label2";
				this.label2.Size = new System.Drawing.Size (72, 23);
				this.label2.TabIndex = 74;
				this.label2.Text = "T?n c?:";
				this.label2.TextAlign = ContentAlignment.MiddleRight;
				this.label1.Location = new Point (36, 87);
				this.label1.Name = "label1";
				this.label1.Size = new System.Drawing.Size (80, 23);
				this.label1.TabIndex = 76;
				this.label1.Text = "T?n m?i:";
				this.label1.TextAlign = ContentAlignment.MiddleRight;
				this.txtOld.BorderStyle = BorderStyle.FixedSingle;
				this.txtOld.ForeColor = SystemColors.HotTrack;
				this.txtOld.Location = new Point (119, 55);
				this.txtOld.Name = "txtOld";
				this.txtOld.Size = new System.Drawing.Size (208, 23);
				this.txtOld.TabIndex = 73;
				this.txtOld.Text = "";
				this.txtOld.KeyPress += new KeyPressEventHandler (this.txtTenTuongUng_KeyPress);
				this.txtNew.BorderStyle = BorderStyle.FixedSingle;
				this.txtNew.ForeColor = SystemColors.HotTrack;
				this.txtNew.Location = new Point (119, 87);
				this.txtNew.Name = "txtNew";
				this.txtNew.Size = new System.Drawing.Size (208, 23);
				this.txtNew.TabIndex = 75;
				this.txtNew.Text = "";
				this.btUpdate.FlatStyle = FlatStyle.Popup;
				this.btUpdate.Location = new Point (119, 119);
				this.btUpdate.Name = "btUpdate";
				this.btUpdate.Size = new System.Drawing.Size (80, 23);
				this.btUpdate.TabIndex = 77;
				this.btUpdate.Text = "L?u";
				this.btUpdate.Click += new EventHandler (this.btUpdate_Click);
				this.btClose.FlatStyle = FlatStyle.Popup;
				this.btClose.Location = new Point (212, 119);
				this.btClose.Name = "btClose";
				this.btClose.Size = new System.Drawing.Size (80, 23);
				this.btClose.TabIndex = 74;
				this.btClose.Text = "Tho?t";
				this.btClose.Click += new EventHandler (this.btClose_Click);
				theControlArray4 = new Control[4];
				theControlArray4[0] = ((Control) this.label3);
				theControlArray4[1] = ((Control) this.btXoa);
				theControlArray4[2] = ((Control) this.txtXoa);
				theControlArray4[3] = ((Control) this.btExit);
				this.tbXoa.Controls.AddRange (theControlArray4);
				this.tbXoa.Location = new Point (4, 25);
				this.tbXoa.Name = "tbXoa";
				this.tbXoa.Size = new System.Drawing.Size (368, 171);
				this.tbXoa.TabIndex = 2;
				this.tbXoa.Text = "X?a";
				this.label3.Location = new Point (16, 56);
				this.label3.Name = "label3";
				this.label3.Size = new System.Drawing.Size (120, 23);
				this.label3.TabIndex = 79;
				this.label3.Text = "T?n X?t nghi?m:";
				this.label3.TextAlign = ContentAlignment.MiddleRight;
				this.btXoa.FlatStyle = FlatStyle.Popup;
				this.btXoa.Location = new Point (144, 88);
				this.btXoa.Name = "btXoa";
				this.btXoa.Size = new System.Drawing.Size (80, 23);
				this.btXoa.TabIndex = 80;
				this.btXoa.Text = "X?a";
				this.btXoa.Click += new EventHandler (this.btXoa_Click);
				this.txtXoa.BorderStyle = BorderStyle.FixedSingle;
				this.txtXoa.ForeColor = SystemColors.HotTrack;
				this.txtXoa.Location = new Point (144, 56);
				this.txtXoa.Name = "txtXoa";
				this.txtXoa.Size = new System.Drawing.Size (208, 23);
				this.txtXoa.TabIndex = 78;
				this.txtXoa.Text = "";
				this.txtXoa.KeyPress += new KeyPressEventHandler (this.txtTenTuongUng_KeyPress);
				this.btExit.FlatStyle = FlatStyle.Popup;
				this.btExit.Location = new Point (233, 88);
				this.btExit.Name = "btExit";
				this.btExit.Size = new System.Drawing.Size (80, 23);
				this.btExit.TabIndex = 73;
				this.btExit.Text = "Tho?t";
				this.btExit.Click += new EventHandler (this.btExit_Click);
				this.AutoScaleBaseSize = new System.Drawing.Size (7, 15);
				base.ClientSize = new System.Drawing.Size (558, 259);
				theControlArray5 = new Control[3];
				theControlArray5[0] = ((Control) this.tab);
				theControlArray5[1] = ((Control) this.label9);
				theControlArray5[2] = ((Control) this.tvBenh);
				base.Controls.AddRange (theControlArray5);
				this.Font = new System.Drawing.Font ("Verdana", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
				base.Icon = ((System.Drawing.Icon) theResourceManager.GetObject ("$this.Icon"));
				base.MaximizeBox = false;
				base.MinimizeBox = false;
				base.Name = "frmXetNghiem";
				base.StartPosition = FormStartPosition.CenterScreen;
				this.Text = "X?t Nghi?m";
				base.Load += new EventHandler (this.frmXetNghiem_Load);
				this.tab.ResumeLayout (false);
				this.tbThem.ResumeLayout (false);
				this.tbCapNhat.ResumeLayout (false);
				this.tbXoa.ResumeLayout (false);
				base.ResumeLayout (false);
				return;
			}
			
			private void insertChildNode (string strName, DataRow row)
			
			{
				this.node2 = ((TreeNode) new MyNode (row));
				this.node2.Text = strName;
				return;
			}
			
			private void insertChildNode3 (string strName, DataRow row)
			
			{
				this.node3 = ((TreeNode) new MyNode (row));
				this.node3.Text = strName;
				return;
			}
			
			private void insertChildNode4 (string strName, DataRow row)
			
			{
				this.node4 = ((TreeNode) new MyNode (row));
				this.node4.Text = strName;
				return;
			}
			
			private void insertChildNode5 (string strName, DataRow row)
			
			{
				this.node5 = ((TreeNode) new MyNode (row));
				this.node5.Text = strName;
				return;
			}
			
			private void insertParentNode (string strName, DataRow row)
			
			{
				this.node = ((TreeNode) new MyNode (row));
				this.node.Text = strName;
				return;
			}
			
			private void LoadXetNghiem ()
			
			{
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				DataTable theDataTable;
				int i;
				int i2;
				SqlDataAdapter theSqlDataAdapter2;
				DataSet theDataSet2;
				int i3;
				SqlDataAdapter theSqlDataAdapter3;
				DataSet theDataSet3;
				int i4;
				SqlDataAdapter theSqlDataAdapter4;
				DataSet theDataSet4;
				int i5;
				SqlDataAdapter theSqlDataAdapter5;
				DataSet theDataSet5;
				int i6;
				this.arrPltISN.Clear ();
				this.arrPltName.Clear ();
				this.arrCha.Clear ();
				theSqlConnection = new SqlConnection (this.con);
				theSqlDataAdapter = new SqlDataAdapter ("select distinct nlpISNLevelOne,nlpNameLevelOne from vw_AnalyzeTree where nlpName"
				+ "LevelOne is not null order by nlpNameLevelOne", theSqlConnection);
				theDataSet = new DataSet ();
				int i7 = theSqlDataAdapter.Fill (theDataSet, "vw_AnalyzeTree");
				if (theDataSet == null)
				{
					goto L_05C2;
				}
				
			L_0054:
				
				{
				}
				theDataTable = theDataSet.Tables["vw_AnalyzeTree"];
				i = 0;
				goto L_00B8;
				
			L_006A:
				
				{
				}
				int i8 = this.arrPltISN.Add (theDataTable.Rows[i][0].ToString ());
				int i9 = this.arrPltName.Add (theDataTable.Rows[i][1].ToString ());
				i++;
				
			L_00B8:
				
				{
				}
				if (i < theDataTable.Rows.Count)
				{
					goto L_006A;
				}
				i2 = 0;
				goto L_05A4;
				
			L_00CF:
				
				{
				}
				this.insertParentNode (this.arrPltName[i2].ToString (), theDataTable.Rows[i2]);
				int i10 = this.tvBenh.Nodes.Add (this.node);
				theSqlDataAdapter2 = new SqlDataAdapter (string.Concat ("SELECT distinct nlpISNLevelTwo,nlpNameLeveltwo FROM vw_AnalyzeTree WHERE nlpISNL"
				+ "evelOne=", this.arrPltISN[i2].ToString (), " and nlpNameLeveltwo is not null  order by nlpNameLevelTwo"), theSqlConnection);
				theDataSet2 = new DataSet ();
				int i11 = theSqlDataAdapter2.Fill (theDataSet2, "Two");
				i3 = 0;
				goto L_0575;
				
			L_0152:
				
				{
				}
				this.tvBenh.SelectedNode = this.node;
				this.insertChildNode (theDataSet2.Tables["Two"].Rows[i3]["nlpNameLevelTwo"].ToString (), theDataSet2.Tables["Two"].Rows[i3]);
				int i12 = this.tvBenh.SelectedNode.Nodes.Add (this.node2);
				int i13 = this.arrCha.Add (theDataSet2.Tables["Two"].Rows[i3]["nlpNameLevelTwo"].ToString ());
				theSqlDataAdapter3 = new SqlDataAdapter (string.Concat ("SELECT distinct nlpISNLevelThree,nlpNameLevelThree FROM vw_AnalyzeTree WHERE nlp"
				+ "ISNLevelTwo=", theDataSet2.Tables["Two"].Rows[i3]["nlpISNLevelTwo"].ToString (), " and nlpNameLevelthree is not null order by nlpNameLevelThree"), theSqlConnection);
				theDataSet3 = new DataSet ();
				int i14 = theSqlDataAdapter3.Fill (theDataSet3, "Three");
				this.tvBenh.SelectedNode = this.node2;
				i4 = 0;
				goto L_0546;
				
			L_0278:
				
				{
				}
				this.arrCha.Remove (i3);
				this.tvBenh.SelectedNode = this.node2;
				this.insertChildNode3 (theDataSet3.Tables["Three"].Rows[i4]["nlpNameLevelThree"].ToString (), theDataSet3.Tables["Three"].Rows[i4]);
				int i15 = this.tvBenh.SelectedNode.Nodes.Add (this.node3);
				theSqlDataAdapter4 = new SqlDataAdapter (string.Concat ("SELECT distinct nlpISNLevelFourth,nlpNameLevelFourth FROM vw_AnalyzeTree WHERE n"
				+ "lpISNLevelThree=", theDataSet3.Tables["Three"].Rows[i4]["nlpISNLevelThree"].ToString (), " and nlpNameLevelFourth is not null order by nlpNameLevelFourth"), theSqlConnection);
				theDataSet4 = new DataSet ();
				int i16 = theSqlDataAdapter4.Fill (theDataSet4, "Fouth");
				this.tvBenh.SelectedNode = this.node3;
				i5 = 0;
				goto L_0517;
				
			L_0378:
				
				{
				}
				this.tvBenh.SelectedNode = this.node3;
				this.insertChildNode4 (theDataSet4.Tables["Fouth"].Rows[i5]["nlpNameLevelFourth"].ToString (), theDataSet4.Tables["Fouth"].Rows[i5]);
				int i17 = this.tvBenh.SelectedNode.Nodes.Add (this.node4);
				theSqlDataAdapter5 = new SqlDataAdapter (string.Concat ("SELECT distinct nlpISNLevelFifth,nlpNameLevelFifth FROM vw_AnalyzeTree WHERE nlp"
				+ "ISNLevelFourth=", theDataSet4.Tables["Fouth"].Rows[i5]["nlpISNLevelFourth"].ToString (), " and nlpNameLevelFifth is not null order by nlpNameLevelFifth"), theSqlConnection);
				theDataSet5 = new DataSet ();
				int i18 = theSqlDataAdapter5.Fill (theDataSet5, "Fifth");
				this.tvBenh.SelectedNode = this.node4;
				i6 = 0;
				goto L_04E8;
				
			L_0466:
				
				{
				}
				this.tvBenh.SelectedNode = this.node4;
				this.insertChildNode5 (theDataSet5.Tables["Fifth"].Rows[i6]["nlpNameLevelFifth"].ToString (), theDataSet5.Tables["Fifth"].Rows[i6]);
				int i19 = this.tvBenh.SelectedNode.Nodes.Add (this.node5);
				i6++;
				
			L_04E8:
				
				{
				}
				if (i6 < theDataSet5.Tables["Fifth"].Rows.Count)
				{
					goto L_0466;
				}
				theSqlDataAdapter5.Dispose ();
				i5++;
				
			L_0517:
				
				{
				}
				if (i5 < theDataSet4.Tables["Fouth"].Rows.Count)
				{
					goto L_0378;
				}
				theSqlDataAdapter4.Dispose ();
				i4++;
				
			L_0546:
				
				{
				}
				if (i4 < theDataSet3.Tables["Three"].Rows.Count)
				{
					goto L_0278;
				}
				theSqlDataAdapter3.Dispose ();
				i3++;
				
			L_0575:
				
				{
				}
				if (i3 < theDataSet2.Tables["Two"].Rows.Count)
				{
					goto L_0152;
				}
				theSqlDataAdapter2.Dispose ();
				i2++;
				
			L_05A4:
				
				{
				}
				if (i2 < this.arrPltISN.Count)
				{
					goto L_00CF;
				}
				theSqlDataAdapter.Dispose ();
				theSqlConnection.Close ();
				
			L_05C2:
				return;
			}
			
			[System.STAThreadAttribute ()]
			private static void Main ()
			
			{
				Application.Run (((Form) new frmXetNghiem ()));
				return;
			}
			
			private void raCha_CheckedChanged (object sender, EventArgs e)
			
			{
				if (! this.raCha.Checked)
				{
					goto L_001D;
				}
				this.lbTen.Text = "T?n c?p cha :";
				
			L_001D:
				return;
			}
			
			private void raCon_CheckedChanged (object sender, EventArgs e)
			
			{
				if (! this.raCon.Checked)
				{
					goto L_001D;
				}
				this.lbTen.Text = "T?n ??ng c?p :";
				
			L_001D:
				return;
			}
			
			private void tvBenh_DoubleClick (object sender, EventArgs e)
			
			{
				this.btLuu.Enabled = true;
				this.btUpdate.Enabled = true;
				this.btXoa.Enabled = true;
				this.txtTenTuongUng.Text = this.tvBenh.SelectedNode.Text.ToString ();
				this.txtOld.Text = this.tvBenh.SelectedNode.Text.ToString ();
				this.txtXoa.Text = this.tvBenh.SelectedNode.Text.ToString ();
				return;
			}
			
			private void txtTenTuongUng_KeyPress (object sender, KeyPressEventArgs e)
			
			{
				e.Handled = true;
				return;
			}
			
		#endregion
	}
	
}

